<script>
export default {
    props: ['categoryShow'],
    data() {
        return {
            hoverCategoryShow: false,
            hoverItemShow: false
        }
    }
}
</script>
<template>
    <div class="item-navigator">
        <div class="navigator-container">
            <div class="category-navigator" @mouseenter="hoverCategoryShow = true" @mouseleave="hoverCategoryShow = false">
                <span class="category-tip">全部商品类目</span>
                <div class="category-list" v-show="categoryShow | hoverCategoryShow | hoverItemShow" @mouseenter="hoverItemShow = true" @mouseleave="hoverItemShow = false">
                    <span class="category-item">护肤</span>
                    <span class="category-item">彩妆</span>
                    <span class="category-item">香水</span>
                    <span class="category-item">工具</span>
                    <span class="category-item">男士</span>
                    <span class="category-item">洗浴护体</span>
                    <span class="category-item">美发护发</span>
                </div>
            </div>
            <div class="topic-navigator">
                <span>畅销榜单</span>
                <span>独家发售</span>
                <span>礼物套装</span>
                <span>全部品牌</span>
                <span>预约中心</span>
            </div>
        </div>
        <img class="declare-img" src="../assets/index/declare-img.png" />
    </div>
</template>
<style scoped>
.item-navigator {
    display: flex;
    height: 36px;
    justify-content: space-between;
    width: 100%;

    .category-tip {
        margin: 0 0 0 20px;
    }

    .navigator-container {
        display: flex;
        align-items: flex-end;
    }

    .category-navigator {
        width: 240px;
        background-image: url('../assets/index/item-category-bg.png');
        font-size: 18px;
        line-height: 36px;
        color: white;
        position: relative;

        .category-list {
            position: absolute;
            width: 100%;
            height: 550px;
            box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.25);
            z-index: 1;
            background-color: white;

            .category-item {
                font-size: 14px;
                font-weight: 800;
                border-top: 1px solid #f5f5f5;
                color: black;
                display: block;
                padding-left: 10px;

                &:hover {
                    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.15);
                }
            }
        }
    }

    .topic-navigator {

        & span {
            font-size: 16px;
            line-height: 20px;
            margin-left: 20px;
            cursor: pointer;

            &:hover {
                color: red;
            }
        }

    }
}
</style>